package com.grao.waterschool.human.entiry.po;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
public class BaseEntity implements Serializable {

    private Integer id;
    /**
     * 创建时间，插入数据时自动填充
     */
    @Schema(description = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;
    /**
     * 修改时间，插入、更新数据时自动填充
     */
    @Schema(description = "修改时间")
    @TableField(value = "modified_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifiedTime;
    /**
     * 删除状态：插入数据时自动填充
     */
    @Schema(description = "删除状态")
    @TableField(value = "delete_status", fill = FieldFill.INSERT)
    @TableLogic
    private boolean deleteStatus;

}
